package com.zhongxi.guoyuan.entity.shopcart;

import org.json.JSONObject;

/**
 * Created by Administrator on 2017/2/18.
 */

public class GoodsAttr {

    private String gid;
    private String cid;
    private String inventory;
    private String viewnum;
    private String soldnum;
    private String attr;

    public String getGid() {
        return gid;
    }

    public void setGid(String gid) {
        this.gid = gid;
    }

    public String getCid() {
        return cid;
    }

    public void setCid(String cid) {
        this.cid = cid;
    }

    public String getInventory() {
        return inventory;
    }

    public void setInventory(String inventory) {
        this.inventory = inventory;
    }

    public String getViewnum() {
        return viewnum;
    }

    public void setViewnum(String viewnum) {
        this.viewnum = viewnum;
    }

    public String getSoldnum() {
        return soldnum;
    }

    public void setSoldnum(String soldnum) {
        this.soldnum = soldnum;
    }

    public String getAttr() {
        return attr;
    }

    public void setAttr(String attr) {
        this.attr = attr;
    }

    public static GoodsAttr parseMatch(JSONObject obj){
        GoodsAttr attr = new GoodsAttr();
        try{
            attr.setGid(obj.getString("gid"));
            attr.setCid(obj.getString("cid"));
            attr.setInventory(obj.getString("inventory"));
            attr.setViewnum(obj.getString("viewnum"));
            attr.setSoldnum(obj.getString("soldnum"));
            attr.setAttr(obj.getString("attr"));
        }catch (Exception e){
            e.printStackTrace();
        }
        return attr;
    }
}
